package com.atguigu.util.method_son;

import com.atguigu.util.method_fa.Vehicle;

/**
 * @author caesar
 * @date 2025/7/7
 * @Description:
 * @apiNote
 */
public class Car extends Vehicle {
    private int numDoors;

    public Car() {
    }

    public Car(double speed, String color, int numDoors) {
        super(speed, color);
        this.numDoors = numDoors;
    }

    @Override
    public void move() {
        System.out.println("汽车正在移动");
    }

    public int getNumDoors() {
        return numDoors;
    }

    public void setNumDoors(int numDoors) {
        this.numDoors = numDoors;
    }

    @Override
    public String toString() {
        return "门的数量：" + numDoors +
                super.toString();
    }
}
